package com.chenxiao.prototype;

/**
 * @Author: CX
 * @Date: Created in  2023/02/04 16:28
 * @version: v1.0
 * @Description: TODO
 **/
public class Sheep implements Cloneable {
    private String name;
    private String color;
    private int age;

    public Sheep(String name, String color, int age) {
        this.name = name;
        this.color = color;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
    @Override
    public String toString(){
        return "sheep name:" + name + "age:" + age + " color:" + color;
    }

    @Override
    protected Object clone() {
        Sheep sheep = null;
        try {
            sheep = (Sheep) super.clone();
        }catch (CloneNotSupportedException e){
            System.out.println(e);
        }
        return sheep;
    }
}
